<?php
namespace app\admin\controller;

use app\common\model\Admin as A;
use think\Session;
class Index  extends Common
{
    public function index()
    {
         $id=input('param.id');

        $this->assign('id',$id);
        //导航管理
        $daoh=$this->auth_group();
        $ssname=Session::get('admin_username');
        $this->assign('ssname',$ssname);
        $this->assign('daoh',$daoh);
        return $this->fetch();
    }
    public function logout()
    {
	
        		//清除session
        		session(null);
        		//$this->success('退出成功','admin/index/index');
				$this->redirect('admin/index/index');
		
      //return $this->fetch();
    }
    public function welcome()
    {
        //echo '123213';
     //halt($_SERVER);
        return $this->fetch();
    }
    //清除缓存
    public function dele()
    {
         if(request()->isPost())
            {
        //halt($_POST);
               $types=new A();
                $res=$types->type_dele(input('post.'));
                    $mess=array(
                        'status'=>$res['valid'],
                        'message'=>$res['msg']
                    );
                    return $mess;
            }

    }
    
}
